package xyz.xtt.equity.api.enums;

/**
 * @author dale
 * @date 2025/2/11
 **/
public enum BenefitPurchasePayStatusEnum {
	/**
	 * 未支付
	 */
	NOT_PAYED(0, "未支付"),
	/**
	 * 已支付
	 */
	PAID(1, "已支付"),
	/**
	 * 已取消
	 */
	CANCEL(2, "已取消"),
	/**
	 * 已取消
	 */
	EXPIRE(3, "已取消"),

	/**
	 * 待退款
	 */
	NEED_REFUND(5, "待退款"),
	/**
	 * 退款中
	 */
	REFUNDING(6, "退款中"),
	/**
	 * 已退款
	 */
	REFUNDED(7, "已退款");

	/**
	 * 编码
	 */
	private int code;
	/**
	 * 描述
	 */
	private String desc;

	BenefitPurchasePayStatusEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public int code() {
		return code;
	}

	public static BenefitPurchasePayStatusEnum getEnumByCode(int code) {
		for (BenefitPurchasePayStatusEnum value : BenefitPurchasePayStatusEnum.values()) {
			if (value.code == code) {
				return value;
			}
		}
		return null;
	}
}
